package effect;

import card.CreatureCard;
import core.Tile;

/**
 * 
 * @author Oscar
 *
 * TODO Add mana cost.
 */
public class Blizzard extends Effect {
	public Blizzard(){
		name="Blizzard";
		description="Creates a raging blizzard that deals 1 damage to all creatures in target land.";
		imageName="cardIconBlizzard.png";
		effectTypes.add(EffectType.activatable);
		targetType=TargetType.tile;
		manaCost=10;
	}
	
	@Override
	public void activate(Tile tile){
		EffectUtil.getCard(this).getOwner().addMana(-10);
		for(CreatureCard c : tile.getCreatures())
			c.setCurrentHealth(c.getCurrentHealth()-1);
	}
	
	@Override
	public boolean canActivate(){
		if(EffectUtil.getCard(this).getOwner().getMana()>=10)
			return true;
		else
			return false;
	}
	
	@Override
	public boolean canActivate(Tile tile){
		System.out.println(tile.getOccupyingPlayer());
		System.out.println(EffectUtil.getCard(this).getOwner());
		if(tile.getOccupyingPlayer() == EffectUtil.getCard(this).getOwner()) 
			return false;
		return true;		
	}
}
